import {  h } from "vue";
import { render } from "@/utils";
import LinkText from "@/components/LinkText/index.vue";


export const columns = [
  {
    title: "插件名称",
    dataIndex: "name",
    render: ({ record }) =>
      h(LinkText, { label: record?.name, to: `/plugin-mgmt/detail/${record?.component}?name=${record?.name}`}),
  },
  {
    title: "插件标识",
    dataIndex: "name",
    render,
    // width: 200,
  },
  {
    title: "是否启用",
    dataIndex: "enabled",
    slotName: "enabled",
  },
  {
    title: "创建信息",
    dataIndex: "lastTime",
    slotName: "lastTime",
    width: 200,
    render: ({ record }) =>
      h(LinkText, { label: record?.createTime, desc: record?.createBy }),
  },
  {
    title: "变更信息",
    width: 200,
    render: ({ record }) =>
      h(LinkText, { label: record?.updateTime, desc: record?.updateBy}),
  },
  {
    title: "操作",
    width: 120,
    dataIndex: "action",
    fixed: "right",
    slotName: "action",
  }
]
export const cloudColumns = [
  {
    title: "ID",
    dataIndex: "bkCloudId",
    // slotName: "ID",
  },
  {
    title: "名称",
    dataIndex: "bkCloudName",
    render,
  },
  {
    title: "管理子网",
    dataIndex: "status",
  },
]
export const busizColumns = [
  {
    title: "ID",
    dataIndex: "bkBizId",
    // slotName: "ID",
  },
  {
    title: "业务名称",
    dataIndex: "bkBizName",
    render,
  }
]